## Universidade Federal do Rio Grande do Sul - Instituto de Informatica
## Departamento de Informatica Teorica
## Modelos de Linguagem de Programacao - 2013/1
## Professor: Lucas Schnorr
## Alunos: Felipe Schimidt e Mario Gasparoni Junior
##
##
## 
## Implementacao do modulo 'score' seguindo recomendacoes em:
## http://www.pygame.org/docs/
import pygame, commons

#This must be a 'singleton', intantiated just once in the game preferentialy in the main class
class Score:
	
	life = commons.PLAYER_LIFE
	score = 0
	
	def track(self, screen):
		myfont = pygame.font.SysFont("monospace", 16)
		label = myfont.render("Life: " + str(commons.PLAYER_LIFE) + "%", 1, (255,255,0))
		screen.blit(label, (530, 5))
		label = myfont.render("Score: " + str(self.score), 1, (255,255,0))
		screen.blit(label, (5, 5))
		label = myfont.render("Ultra Hits: " + str(commons.ULTRA_SPOONS), 1, (255,255,0))
		screen.blit(label, (250, 5))

	def draw_life(self):
		self.life -= 5
		if self.life <= 95:
			myfont = pygame.font.SysFont("monospace", 50)
			label = myfont.render("GAME OVER!", 1, (255,255,0))
			screen.blit(label, (320, 170))
